{include file="public/header"}

<body>
<div class="page-container">
	<form class="form form-horizontal" id="form" method="post">
		<div class="ch-row ch-info-form">
			<div class="flex2 ch-row ">
                <textarea style="width: 468px;margin:0;height: 152px;" name="content"
						  class="form-control  content" >{$data.content}</textarea>
			</div>

		</div>


		<div class="ch-row ch-info-form" style="margin-top: 0 ">
			<div class="flex1">
				<button class="btn btn-primary radius" data-id="{$data.id}" type="button"><i class="Hui-iconfont">&#xe632;</i> 提交
				</button>
			</div>
		</div>
	</form>
</div>

{include file="public/footer"}
<script>
    /**
     * 推送消息
     */
    $('.radius').click(function () {
        var id=$(this).attr('data-id');
		var src="{:Url('index/message/edit')}";
        var reason=$('.content').val();

		$.ajax({
                type: 'POST',
                url: src,
                dataType: 'json',
                data: {id:id,content:reason},
                success: function (data) {
                    var res=JSON.parse(data);
                    if(res.code==200){
                        layer.msg(res.msg, {icon: 1, time: 2000}, function () {

							setTimeout(" window.parent.location.reload();", 1);
                        });
                    }else{
                        layer.msg(res.msg,{icon: 5,time:1000});
                    }

                },
                error: function (data) {
                    console.log(data.msg);
                },

        });
    });
</script>

